import { Component } from '../../engine/ecs/components/component';

export class EnemyComponent extends Component {
  #lifesLeft: number;

  constructor(public readonly countOfLifes = 1) {
    super();

    this.#lifesLeft = countOfLifes;
  }

  hit(): boolean {
    this.#lifesLeft--;

    return this.#lifesLeft <= 0;
  }
}
